package com.hotec.PROJECT_NAME.modules.sys.mapper;

import com.hotec.PROJECT_NAME.modules.sys.entity.SysMessage;
import com.hotec.PROJECT_NAME.component.basic.BasicMapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.SelectProvider;

import java.util.LinkedHashMap;
import java.util.List;


/**
 * @author llb
 * @date
 */
public interface SysMessageMapper extends BasicMapper<SysMessage> {

    @SelectProvider(type = SysMessageProvider.class, method = "queryMyMessage")
    List<SysMessage> queryMyMessage(@Param("e") LinkedHashMap param);

    class SysMessageProvider {
        public String queryMyMessage(@Param("e")  LinkedHashMap param) {
            StringBuilder sb = new StringBuilder("select a.* FROM sys_message a left join  sys_message_account b  " +
                    "on a.id =b.account_id where b.account_id =#{e.accountId}");
            return sb.toString();
        }
    }
}

